Skip to content

fix: stop GitHub from evaluating example expressions in action.yml#11

Merged
lukekim merged 1 commit into
trunkfrom
fix/action-yml-expressions
May 2, 2026
Merged

fix: stop GitHub from evaluating example expressions in action.yml#11
lukekim merged 1 commit into
trunkfrom
fix/action-yml-expressions

Conversation

@lukekim
Copy link
Copy Markdown
Contributor

@lukekim lukekim commented May 2, 2026

Summary

Every workflow that tries to use this action currently fails at load time with errors like:

```
Error: spicehq/spice-cloud-deploy-action//action.yml (Line: 43, Col: 18): Unrecognized named-value: 'github'. Located at position 1 within expression: github.sha
Error: ... Unrecognized named-value: 'secrets'. Located at position 1 within expression: secrets.OPENAI_API_KEY
Error: Failed to load spicehq/spice-cloud-deploy-action//action.yml
```

GitHub's runner evaluates `${{ ... }}` expressions that appear anywhere in `action.yml` — including inside `description:` blocks — when it loads the manifest. The `tags`, `branch`, `commit-sha`, and `secrets` input descriptions had literal `${{ github.sha }}` / `${{ github.ref_name }}` / `${{ secrets.* }}` tokens as documentation examples, and there's no `github`/`secrets` context at action-load time, so the runner errors out before the action even starts.

Fix

Replace the four offending example tokens with placeholders that don't look like Actions expressions:

Before After
`commit: ${{ github.sha }}` (tags example) `commit: `
`` Defaults to `${{ github.ref_name }}`. `` (branch) `` Defaults to the `GITHUB_REF_NAME` environment variable. ``
`` Defaults to `${{ github.sha }}`. `` (commit-sha) `` Defaults to the `GITHUB_SHA` environment variable. ``
`OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}` (secrets) `OPENAI_API_KEY=`

Real workflow examples in `README.md` and `examples/` are unaffected — expressions inside workflow files (consumer-side) are evaluated normally; the bug only existed in the action's own manifest.

Test plan

  • `grep -nE '\$\{\{' action.yml` returns no matches.
  • CI green on this PR.
  • After merge: a workflow that pins to the new `@v1` tag loads the manifest without errors.

Severity

This is a release blocker — the v1.0.0 tag cannot be cut on top of `f84b3ab` because every consumer immediately hits the load error. Recommend merging and then re-tagging `v1.0.0` from the post-merge commit.

GitHub's runner evaluates `${{ ... }}` tokens that appear anywhere in
`action.yml` — including inside `description:` blocks — when it loads
the action manifest. Embedding `${{ github.sha }}` and
`${{ secrets.OPENAI_API_KEY }}` literally as documentation examples
caused every workflow that referenced this action to fail at load time
with `Unrecognized named-value: 'github'` and `'secrets'`.

Replace the four offending example tokens with placeholders that don't
resemble Actions expressions:

- `tags` example: `commit: ${{ github.sha }}` → `commit: <commit-sha>`
- `branch` description: ``Defaults to `${{ github.ref_name }}`.`` →
  ``Defaults to the `GITHUB_REF_NAME` environment variable.``
- `commit-sha` description: same treatment with `GITHUB_SHA`.
- `secrets` example: `KEY=${{ secrets.* }}` → `KEY=<placeholder>`.

Real workflow examples in README.md and examples/ are unaffected
because expressions inside workflow files are evaluated normally.
Copilot AI review requested due to automatic review settings May 2, 2026 23:12
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes a GitHub Actions manifest load-time failure caused by ${{ ... }} tokens embedded in action.yml input description examples (which GitHub evaluates while parsing the action manifest, before runtime contexts like github/secrets exist).

Changes:

  • Replaced ${{ github.* }} example tokens in input descriptions with non-expression placeholders / environment variable references.
  • Replaced ${{ secrets.* }} example tokens with placeholder values to prevent manifest parsing errors.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@lukekim lukekim self-assigned this May 2, 2026
@lukekim lukekim merged commit e9b53eb into trunk May 2, 2026
8 checks passed
@lukekim lukekim deleted the fix/action-yml-expressions branch May 2, 2026 23:17
@lukekim lukekim mentioned this pull request May 2, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants